<template>
  <a-drawer
    :maskClosable="true"
    :width="drawerWidth"
    placement="right"
    :closable="true"
    @close="handleCancel"
    :visible="visible"
  >

    <template slot="title">
      <div style="width: 100%;">
        <span>{{ title }}</span>
        <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right">
          <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button>
        </span>
      </div>

    </template>

    <a-spin :spinning="confirmLoading" class="drawer-content">
      <a-form :form="form">
        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol"  label="机构">
          <ak-tree-select :url="sysDepartUrl.tree"
                          v-decorator="[ 'sysDepartId',{rules:getValidatorRolesRequired()}]"/>
        </a-form-item>
        <a-form-item label="域名" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input autocomplete="off" v-decorator="[ 'domain',  {rules:getValidatorRolesDulicateCheck(200)}]" />
        </a-form-item>

        <a-form-item label="网站名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input autocomplete="off" v-decorator="[ 'name',  {rules:getValidatorRolesMaxLength(200)}]" />
        </a-form-item>
        <a-form-item label="版权copyright" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input autocomplete="off" v-decorator="[ 'copyright',  {rules:getValidatorRolesMaxLength(200)}]" />
        </a-form-item>
        <a-form-item label="备案号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input autocomplete="off" v-decorator="[ 'recordNum',  {rules:getValidatorRolesMaxLength(200)}]" />
        </a-form-item>

        <a-form-item label="logo" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <ak-upload :fileLength="1" type="cms_logo" v-decorator="['logo', {initialValue:''}]"></ak-upload>
        </a-form-item>

        <a-form-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input autocomplete="off" v-decorator="[ 'title',  {rules:getValidatorRolesMaxLength(200)}]" />
        </a-form-item>
        <a-form-item label="关键字" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input autocomplete="off" v-decorator="[ 'keywords',  {rules:getValidatorRolesMaxLength(200)}]" />
        </a-form-item>
        <a-form-item label="页面描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-textarea autocomplete="off" v-decorator="[ 'description',  {rules:getValidatorRolesMaxLength(200)}]" />
        </a-form-item>
        <a-form-item label="js 增强" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-textarea autocomplete="off" v-decorator="[ 'scriptAdd']" />
        </a-form-item>
        <a-form-item label="css 增强" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-textarea autocomplete="off" v-decorator="[ 'styleAdd']" />
        </a-form-item>

      </a-form>
    </a-spin>


    <div class="drawer-bootom-button" v-show="!disableSubmit">
      <a-popconfirm title="确定放弃编辑？" @confirm="handleCancel" okText="确定" cancelText="取消">
        <a-button style="margin-right: .8rem">取消</a-button>
      </a-popconfirm>
      <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button>
    </div>
  </a-drawer>
</template>

<script>

  import AkUpload from '../../../components/akfh/AkUpload'
  import {cmsUrl, sysDepartUrl} from '../../../api/url'
  import AkfhModelDrawMixin from "../../../mixin/AkfhModelDrawMixin";
  import AkTreeSelect from "../../../components/akfh/AkTreeSelect";
  import ATextarea from 'ant-design-vue/es/input/TextArea'

  export default {
    name: "CmsModal",
    mixins:[AkfhModelDrawMixin],
    components: {
      ATextarea,
      AkTreeSelect,
      AkUpload,
    },
    data () {
      return {
        entity:'CmsEntity',
        url: cmsUrl,
        sysDepartUrl:sysDepartUrl

      }
    },
    methods: {



    }
  }
</script>

<style scoped>

</style>
